package descriptor;

import java.io.Serializable;


/**
 * UserDescriptor
 * 
 * @author Mathieu MARET
 * 
 * The UserDescriptor class defines a constructor to obtain a Java object corresponding to an instance of the user's bean.
 * And it provides all the methods to get or set the user's details.
 * 
 */
public class UserDescriptor implements Serializable{
	private int userId = 0;
	private String name = "";
	private String firstName = "";
	private String login = "";
	private String mail = "";
	private String passwd = "";
	private int type = 0;
	public UserDescriptor(){}
	public UserDescriptor(int userId, String firstName, String name,String login, String passwd, String mail, int type) {
		super();
		this.userId = userId;
		this.name = name;
		this.firstName = firstName;
		this.login = login;
		this.mail = mail;
		this.passwd = passwd;
		this.type = type;
	}
	public String getFirstName() {
		return firstName;
	}
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}
	public String getMail() {
		return mail;
	}
	public void setMail(String mail) {
		this.mail = mail;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getPasswd() {
		return passwd;
	}
	public void setPasswd(String passwd) {
		this.passwd = passwd;
	}
	public int getType() {
		return type;
	}
	public void setType(int type) {
		this.type = type;
	}
	public int getUserId() {
		return userId;
	}
	public void setUserId(int userId) {
		this.userId = userId;
	}
	public String getLogin() {
		return login;
	}
	public void setLogin(String login) {
		this.login = login;
	}
	public String getTypeName(){
		String result = "";
		if (type == 1){
			result = "Student";
		}else if (type == 2){
			result = "Admin";
		}else if (type == 3){
			result = "Comp. Sup.";
		}else if (type == 4){
			result = "Career";
		}else if (type == 5){
			result = "Marker";
		}else if (type == 6){
			result = "Recruiter";
		}else if (type == 7){
			result = "Acad. Sup.";
		}
		return result;
		
	}
	
}
